<?php 
if(isset($javascript)):
    $javascript->link("tiny_mce/tiny_mce.js",false);
endif;
?>

<?php
$num = $numbering->buildstring($levels);
$no=0;
foreach ($decisions as $decision) {
    if($no%2==1){
        $class_minute='<div class="minute_even">';
    }else{
        $class_minute='<div>';
    }
    echo $class_minute;
    if ($levels[$decision['Decision']['id']] > 0) { // if it's a sub item
        echo $this->element('minutes/construct_table',array(
            'decision'=>$decision,
            'node'=>$decision['Decision']['id'],
            'numbering'=>$num[$decision['Decision']['id']],
            'level'=>$levels[$decision['Decision']['id']]));
    } else { // top level
        echo $this->element('minutes/display_minute_item',array(
            'decision'=>$decision,
            'node'=>$decision['Decision']['id'],
            'numbering'=>$num[$decision['Decision']['id']],
            'level'=>$levels[$decision['Decision']['id']]));
    }
    echo '</div>';
    $no++;
}
?>
<div id="displayminute_0" style="display:none;"></div>
<div id="displayform_0">
<?php
//array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'decisions','action'=>'minuteform','id'=>$id,'meetingid'=>$meetingid,'node'=>$node),
	if ( isset($report) != 1 ) { 
		echo $this->element('minutes/minute_form',array('node'=>'new','meetingid'=>$meetingid,'id'=>'0'));
	}
    if($this->params['action']=='printminutes' && (!empty($chairperson) || !empty($permission['Minute approval']['Create']))&& empty($minutes_approved) ){
        echo "<br />";
        echo $form->create('Decision',array('url'=>array('action'=>'minutecomment','committee'=>$this->params['committee'],'id'=>$decisions[0]['Decision']['meeting_id'])));
        echo "<div align='right'>";
        echo $form->button(__('Send Comment to Secretariat', true), array('type'=>'submit','class'=>'minutecomment'));
        echo "</div>";
        echo $form->end();
    }elseif($this->params['action']=='printminutes' && !empty($isSec) && empty($minutes_approved) ){
        echo "<br />";
        echo "<div align='right' 'class'='minutecomment'>";
        echo ' [ '.$html->link(__("Make the changes",true),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'decisions','action'=>'minutes','id'=>$decisions[0]['Decision']['meeting_id']),array('target'=>'_blank')).' ] ';
        echo "</div>";
    }
?>
</div>
